Skip to content

Conversation

jasondaming
Copy link
Member

Summary

Significantly expands the kinematics introduction article to address issue #1291 by explaining why teams should use kinematics/odometry and when to choose each drivetrain type.

Changes

New "Why use kinematics and odometry?" Section

  • Enhanced Autonomous Performance: Explains accurate path following, position tracking, and self-correction with vision
  • Field-Oriented Control: Describes benefits for holonomic drives and driver experience
  • Trajectory Generation and Following: Integration with path planning tools
  • Common Use Cases: Real-world examples of autonomous routines, vision-assisted driving, teleoperation enhancement

New "When to use each drivetrain type" Section

Differential Drive:

  • Best for: Traditional tank drive, high traction/pushing power, simpler builds
  • Characteristics: Non-holonomic, high pushing power, simpler mechanical design
  • Links to RamseteCommand example

Swerve Drive:

  • Best for: Maximum maneuverability, competitive teams with experience
  • Characteristics: Holonomic, highest mobility, most complex
  • Links to SwerveBot and SwerveControllerCommand examples

Mecanum Drive:

  • Best for: Holonomic drive with simpler mechanics than swerve
  • Characteristics: Can strafe, lower pushing power, simpler than swerve
  • Links to MecanumBot and MecanumControllerCommand examples

Important Considerations

  • Odometry drift and vision-based corrections
  • Sensor requirements for each drivetrain
  • Autonomous period accuracy expectations
  • Coordinate system reference

Impact

This expansion transforms the article from a purely technical reference into a practical guide that helps teams:

  1. Understand the benefits of using kinematics and odometry
  2. Choose the appropriate drivetrain type for their needs
  3. Know what sensors and setup are required
  4. Find relevant example code for their chosen drivetrain

Fixes #1291

- Added 'Why use kinematics and odometry' section explaining benefits
- Enhanced autonomous performance discussion (path following, position tracking)
- Field-oriented control benefits for holonomic drives
- Trajectory generation and common use cases
- Added 'When to use each drivetrain type' section
- Differential drive: best for traction, pushing power, simpler builds
- Swerve drive: maximum maneuverability, most complex
- Mecanum drive: holonomic with simpler mechanics than swerve
- Added important considerations (drift, sensors, accuracy)
- Links to example code for each drivetrain type

Fixes wpilibsuite#1291

## Important considerations

**Odometry drift**: Position estimates accumulate error over time, especially during physical contact with other robots. This is normal and expected. Vision-based corrections (using AprilTags) help maintain accuracy.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Odometry drift**: Position estimates accumulate error over time, especially during physical contact with other robots. This is normal and expected. Vision-based corrections (using AprilTags) help maintain accuracy.
**Odometry drift**: Position estimates accumulate error over time, especially during physical contact with other robots and field elements. This is normal and expected. Vision-based corrections (using AprilTags) help maintain accuracy.

- Gyroscope for measuring robot angle (critical for accurate odometry)
- For swerve: absolute encoders for module angles

**Autonomous period accuracy**: Odometry is typically very accurate during autonomous (15 seconds) because there's less robot-to-robot contact. Estimates may drift more during teleoperation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Autonomous period accuracy**: Odometry is typically very accurate during autonomous (15 seconds) because there's less robot-to-robot contact. Estimates may drift more during teleoperation.
**Autonomous period accuracy**: Odometry is typically very accurate during autonomous (15 seconds) because there's less robot-to-robot contact. Estimates may drift more during teleop.

Using language from the manual. TELEOP is in the glossary for "the Teleoperated Period".

@katzuv
Copy link
Contributor

katzuv commented Oct 11, 2025

Perhaps the comparison between different drivetrain types fits more elsewhere?


**Match strategy**: Plan routes that avoid defense, optimize cycle times, coordinate with alliance partners

## When to use each drivetrain type
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels really out of place to talk about drivetrain selection in kinematics/odometry. The drivetrain selection should drive the code, and these characteristics have nothing to do with kinematics or odometry.

- Requires precise module control and calibration
- Can use high-traction wheels

**Example code**: See the SwerveBot and SwerveControllerCommand examples in :doc:`/docs/software/examples-tutorials/wpilib-examples`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given wpilibsuite/allwpilib#5098 I'm not sure I'd recommend the WPILib examples.

### Mecanum Drive

**Best for:**
- Teams wanting holonomic drive with simpler mechanics than swerve
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the slipping problem, I think the simpler mechanics is more theoretical then practical

**Odometry drift**: Position estimates accumulate error over time, especially during physical contact with other robots. This is normal and expected. Vision-based corrections (using AprilTags) help maintain accuracy.

**Sensor requirements**: All kinematics implementations require:
- Encoders for measuring wheel/module speeds and positions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning for mentioning module speeds and positions? Isn't module speed the same as wheel speed and module position is covered below.

- Robots that benefit from strafing but don't need maximum pushing power
- When compactness is important

**Characteristics:**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do accurate odometry on mecanum? Or do you need vision?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this depends on:

  1. What do you consider accurate? Its tolerances are not good compared to other options but if you need broad strokes movement like in some shooting games it is just fine without.
  2. A dead wheel significantly helps. It adds complexity but not having one can give more inconsistent results
  3. How complex is the movement and at what speeds?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was statements like these that make me question. https://www.chiefdelphi.com/t/end-of-mecanum-drive/433615/119


**Self-correction**: Combined with vision systems (like AprilTag detection), odometry can be continuously updated to correct for drift and maintain accuracy throughout a match.

### Field-Oriented Control
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really related to kinematics and odometry?


**Vision-assisted driving**: Use AprilTags or other vision targets to update odometry and drive to precise field locations

**Teleoperation enhancement**: Field-oriented control for intuitive driving of holonomic robots
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other then gyro, you don't need kinematics or odometry for field oriented control, right?

Changes based on reviewer feedback:

1. Removed "When to use each drivetrain type" section - reviewers felt
   drivetrain selection should drive code choice, not vice versa, and
   these characteristics aren't directly related to kinematics/odometry

2. Removed "Field-Oriented Control" section - field-oriented control
   doesn't require full kinematics/odometry (just gyro), so it was
   misleading to include here

3. Replaced WPILib example references with vendor examples that follow
   best practices:
   - CTRE Phoenix6 examples (differential and swerve with PathPlanner)
   - REV MAXSwerve Template
   - YAGSL (Yet Another Generic Swerve Library)

   This addresses allwpilib#5098 which notes WPILib swerve examples
   use quadrature encoders instead of absolute encoders

4. Added mecanum odometry accuracy considerations including:
   - Wheel slipping issues
   - Benefits of dead wheels for improved accuracy
   - Vision-based correction recommendations

5. Applied minor wording improvements:
   - Added "and field elements" to odometry drift explanation
   - Changed "teleoperation" to "the Teleoperated Period" per manual glossary
   - Simplified sensor requirements to remove confusing "module speeds
     and positions" wording

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Kinematic Articles

3 participants